<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <title>Title</title>
    <style>
        *, html, body {
            background-color: rgb(246,246,246);
        }

        td, th {
            text-align: center;
            vertical-align: middle !important;
        }

        img {
            width: 100px;
            height: 100px;
        }
    </style>
</head>
<body>
<div>
    <%--<h3 style="text-align: center">文件下载</h3>--%>
    <p>&nbsp;</p>
    <%--<form action="${pageContext.request.contextPath}/FileUpServlet" class="form-inline" enctype="multipart/form-data"--%>
    <%--method="post">--%>


    <%--请输入下载文件名: <input type="text" name="name">--%>
    <%--<input type="submit" value="提交" class="btn btn-primary">--%>
    <%--</form>--%>
    <form id="form" action="${pageContext.request.contextPath}/#" method="post">
        <table border="1" class="table table-bordered table-hover">
            <tr class="success">

                <th>编号</th>
                <th>内容</th>
                <th>名称</th>
                <th>操作</th>

                <%--<th>操作</th>--%>
            </tr>

            <c:forEach items="${sessionScope.pageBeanData.list}" var="t" varStatus="s">
                <tr>

                    <td>${s.count}</td>
                    <td><img src="${t.f_path}" class="img-circle" alt=""></td>
                    <td>${t.f_name}</td>
                    <td>
                        <a class="btn btn-success btn-sm"
                           href="${pageContext.request.contextPath}/ShangChuanDate/download?id=${t.f_id}">下载
                        </a>&nbsp;
                    </td>
                </tr>
            </c:forEach>
        </table>
    </form>
</div>
<div>
    <nav aria-label="Page navigation">
        <ul class="pagination ">
            <li>

                <c:if test="${sessionScope.pageBeanData.currentPage-1>0}">
                    <a href="${pageContext.request.contextPath}/ShangChuanDate/find?currentPage=${sessionScope.pageBeanData.currentPage-1}"
                       aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </c:if>
                <c:if test="${sessionScope.pageBeanData.currentPage-1<=0}">
                    <a href="${pageContext.request.contextPath}/ShangChuanDate/find?currentPage=1"
                       aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </c:if>

            </li>

            <c:forEach begin="1" end="${sessionScope.pageBeanData.totalPage}" var="i">
                <li class=""><a
                        href="${pageContext.request.contextPath}/ShangChuanDate/find?currentPage=${i}">${i}</a>
                </li>
            </c:forEach>

            <li>
                <c:if test="${sessionScope.pageBeanData.currentPage-sessionScope.pageBeanData.totalPage<0}">
                    <a href="${pageContext.request.contextPath}/ShangChuanDate/find?currentPage=${sessionScope.pageBeanData.currentPage+1}"
                       aria-label="Previous">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </c:if>
                <c:if test="${sessionScope.pageBeanData.currentPage-sessionScope.pageBeanData.totalPage>=0}">
                    <a href="${pageContext.request.contextPath}/ShangChuanDate/find?currentPage=${sessionScope.pageBeanData.totalPage}"
                       aria-label="Previous">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </c:if>

            </li>
            <span style="font-size: 25px;margin-left: 5px">
                    共${sessionScope.pageBeanData.totalCount}条记录,当前${sessionScope.pageBeanData.currentPage}页,共${sessionScope.pageBeanData.totalPage}页
                </span>
        </ul>
    </nav>
</div>
</body>
</html>
